<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Page Hide</title>
  </head>
  <body>
    <script>
      (function () {
        let showCount = 0;
        window.addEventListener('load', () => {
          console.log('Load fired');
        });
        window.addEventListener('pagehide', () => {
          showCount++;
          console.log(`pagehide: ${showCount}`)
          document.title = `pagehide: ${showCount}`
          let image = new Image()
          image.src = './pagehide.png?a=123'
        });
        window.addEventListener('pageshow', () => {
          showCount++;
          document.title = `pageshow: ${showCount}`
        });
      })();
    </script>
  </body>
</html>
